dnd: When setting a dnd icon widget, unset old one
authorBenjamin Otte <otte@redhat.com>
Sat, 19 Dec 2015 07:09:06 +0000 (08:09 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 11 Jan 2016 15:56:16 +0000 (16:56 +0100)
Setting a DND icon twice should actually work and not cause warnings the
2nd time.

gtk/gtkdnd.c

index 0907fd91169ef473b8ad33a1e7394e80b03c0b17..c4fd666c3504fbf87f34a783453083c76ed8c243 100644 (file)
@@ -2485,6 +2485,8 @@ gtk_drag_set_icon_widget_internal (GdkDragContext *context,
       gtk_widget_show (widget);
     }
 
+  if (gtk_bin_get_child (GTK_BIN (info->icon_window)))
+    gtk_container_remove (GTK_CONTAINER (info->icon_window), gtk_bin_get_child (GTK_BIN (info->icon_window)));
   gtk_container_add (GTK_CONTAINER (info->icon_window), widget);
 
 out: